package cn.com.blueInfo.bpm.template.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 决策类型
 * @author suxch
 * @since 2025/8/28 22:46
 */
@Getter
@AllArgsConstructor
public enum NodeDecisionType implements BaseEnum<String> {

    /** 决策类型-条件决策 */
    CONDITIONAL("CONDITIONAL", "条件决策"),
    /** 决策类型-默认决策 */
    DEFAULT("DEFAULT", "默认决策");

    @EnumValue
    private final String code;

    @JsonValue
    private final String desc;

    public static NodeDecisionType getByCode(String code) {
        return BaseEnum.getByCode(NodeDecisionType.class, code);
    }

    @JsonCreator
    public static NodeDecisionType getByName(String name) {
        return BaseEnum.getByName(name, NodeDecisionType.class);
    }

}
